import { axios as request  } from '@/utils/request'
import qs from 'qs'

export function get({params}) {
  return request({
    url: 'api/finance/payment?' + qs.stringify(params, {indices: false, encode: false}),
    method: 'get',
  })
}

export default {
  addSettlement(params) {
    return request({
      url: 'api/finance/collection/settlement',
      method: 'post',
      data: params
    })
  },
  addSettlementPlus(params) {
    return request({
      url: 'api/finance/collection/settlementAudit',
      method: 'post',
      data: params
    })
  },
  //获取结算记录
  gegSettlementRecord(params) {
    return request({
      url: 'api/finance/settlement/record',
      method: 'get',
      params: params
    })
  },

  //修改结算保存
  settlementSave(params) {
    return request({
      url: 'api/finance/settlement',
      method: 'put',
      data: params
    })
  },
  //获取承运信息
  getTransport(orderId) {
    return request({
      url: 'api/finance/payment/transport/' + orderId,
      method: 'get',
    })
  },
  //成运费结算
  transportSave(params) {
    return request({
      url: 'api/finance/transport/settlement',
      method: 'post',
      data: params
    })
  },
  //获取其他费用信息
  getOther(orderId) {
    return request({
      url: 'api/finance/payment/extra/' + orderId,
      method: 'get',
    })
  },
  //其他费用结算
  otherSave(params) {
    return request({
      url: 'api/finance/extra/settlement',
      method: 'post',
      data: params
    })
  },
  //撤销
  revoke(id) {
    return request({
      url: 'api/finance/settlement/repeal/' + id,
      method: 'put',
    })
  },
};